package com.mt.api.modules.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: plover
 * @Date: 2022/04/28 15:40
 * @Description:
 */
@Data
@TableName("es_customer_bill")
public class AppCustomerBill implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "客户id")
    private Integer customerId;

    @ApiModelProperty(value = "业务主键id")
    private Integer businessId;

    @ApiModelProperty(value = "业务类型 1-客户结款  2-销售单 3-销售退货单")
    private Integer type;

    @ApiModelProperty(value = "销售金额")
    private Integer salesAmount;

    @ApiModelProperty(value = "结算金额")
    private Integer settleAmount;

    @ApiModelProperty(value = "是否删除 0-否 1-是")
    private Integer deleted;

    @TableField(fill = FieldFill.INSERT)
    private Integer createId;

    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateId;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updater;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public void copy(AppCustomer source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
